Don't emulate map/unmap events for native windows
authorAlexander Larsson <alexl@redhat.com>
Wed, 8 Jul 2009 16:36:24 +0000 (18:36 +0200)
committerAlexander Larsson <alexl@redhat.com>
Wed, 8 Jul 2009 16:47:43 +0000 (18:47 +0200)
We really need to wait for the MapNotify from the xserver to ensure
that the window has been mapped, as it may be delayed by the WM, network
or similar things.

This fixes a problem in the /ui-tests/keys-events gtk test

gdk/gdkwindow.c

index d9b1e5b57e04a1b265b54e9a460fde27a6ebac97..bd253c716daa5ffb546aa76276e99407a12abf34 100644 (file)
@@ -5805,7 +5805,7 @@ gdk_window_show_internal (GdkWindow *window, gboolean raise)
   if (gdk_window_is_viewable (window))
     show_all_visible_impls (private, was_mapped);
 
-  if (!was_mapped)
+  if (!was_mapped && !gdk_window_has_impl (private))
     {
       if (private->event_mask & GDK_STRUCTURE_MASK)
        _gdk_make_event (GDK_WINDOW (private), GDK_MAP, NULL, FALSE);
@@ -6112,7 +6112,7 @@ gdk_window_hide (GdkWindow *window)
   /* all decendants became non-visible, we need to send visibility notify */
   gdk_window_update_visibility_recursively (private, NULL);
 
-  if (was_mapped)
+  if (was_mapped && !gdk_window_has_impl (private))
     {
       if (private->event_mask & GDK_STRUCTURE_MASK)
        _gdk_make_event (GDK_WINDOW (private), GDK_UNMAP, NULL, FALSE);